< previous page page_88 next page >

Page 88
8694cbadb9b1ef7075903f6f95fc1db2.gif
19: Dim set_File As String
20:     set_File = c:\temp\ & tvTreeView.SelectedItem.Key & .txt
21:     Open set_File For Input As #1
22:     ToDo: add code to process the opened file
23:     lblTitle(1).Caption = Edit Mode -  & UCase(tvTreeView.SelectedItem)
24:     txtInput.Text = Input(LOF(1), 1)
25:     Close #1
26: End Sub

Note
When inserting this code into your application, the keys in the Add statements for the TreeView control refer to two text files that reside on my computer. You should change these references
ReadMe and EULAto text files on your computer.

This will give you the ability to select a document, double-click it to open it, and then display the contents in the text box on the right side of the form. To get the text box to behave properly, you must add several lines of code to the SizeControls routine. However, it's easier to replace the entire routine with the one in Listing 3.2 than try to tell you exactly where to add each line of code.
LISTING 3.2 SIZECONTROLS.TXTADDING SEVERAL LINES TO THESizeControlROUTINE.

8694cbadb9b1ef7075903f6f95fc1db2.gif
 1: Sub SizeControls(X As Single)
 2:     On Error Resume Next
 3:
 4:     set the width
 5:     If X < 1500 Then X = 1500
 6:     If X > (Me.Width - 1500) Then X = Me.Width - 1500
 7:     tvTreeView.Width = X
 8:     imgSplitter.Left = X
 9:     lvListView.Left = X + 40
10:     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
11:     lblTitle(0) .Width = tvTreeView.Width
12:     lblTitle(1) .Left = lvListView.Left + 20
13:     lblTitle(1) .Width = lvListView.Width - 40
14:     txtInput.Left = X + 40
15:     txtInput.Width = Me.Width - (tvTreeView.Width + 140)
16:
17:     set the top
18:
19:     If tbToolBar.Visible Then

 
< previous page page_88 next page >

If you like this book, buy it!